<script>
function setname(){

  var monindex=document.getElementById("CiuacademicperiodStartDateMonth").value;
  var yearindex=document.getElementById("CiuacademicperiodStartDateYear").value;
  var monhastaindex=document.getElementById("CiuacademicperiodEndDateMonth").value;
  var yeahastarindex=document.getElementById("CiuacademicperiodEndDateYear").value;
  var index = monindex * 1;
  var name=yearindex+"-"+monindex+" a "+monhastaindex+"-"+yeahastarindex;
  document.getElementById('CiuacademicperiodName').value=name;
}




</script>




<div class="ciuacademicperiods form">
<?php echo $this->Form->create('Ciuacademicperiod');?>
	<fieldset>
		<?php $url=$this->Html->link('Periodo Académico',array('action' => 'index')); ?>
		<?php  $tokens=array(0=>$url, 1=>"Adicionar") ?>
        <?php echo $this->element("breadcrumb", array('tokens'=>$tokens))?>
	<?php
    
		echo $this->Form->input('name');
		echo $this->Form->input('start_date', array('class'=>'selectdateshort','onChange'=>'javascript: setname();return false'));
		echo $this->Form->input('end_date',  array('class'=>'selectdateshort','onChange'=>'javascript: setname();return false'));
		echo $this->Form->input('preregistration_start',array('class'=>'selectdateshort'));
		echo $this->Form->input('preregistration_end',array('class'=>'selectdateshort'));
		echo $this->Form->input('registration_start',array('class'=>'selectdateshort'));
		echo $this->Form->input('registration_end',array('class'=>'selectdateshort'));
		echo $this->Form->input('classes_start',array('class'=>'selectdateshort'));
		echo $this->Form->input('classes_end',array('class'=>'selectdateshort'));
		echo $this->Form->input('score_registration_start',array('class'=>'selectdateshort'));
		echo $this->Form->input('score_registration_end',array('class'=>'selectdateshort'));
		echo $this->Form->input('score_publication',array('class'=>'selectdateshort'));
	?>
	</fieldset>
<?php echo $this->Form->end(__('Submit', true));?>
</div>


